package com.sskj.uboex.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.uboex.bean.Notice;
import com.sskj.uboex.http.HttpConfig;
import com.sskj.uboex.ui.activity.MsgDetailActivity;


public class MsgDetailActivityPresenter extends BasePresenter<MsgDetailActivity> {

    public void getData(String id) {
        httpService.ggDetail(id)
                .execute(new JsonCallBack<HttpData<Notice>>() {
                    @Override
                    public void onSuccess(Response<HttpData<Notice>> response) {
                        HttpData<Notice> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateUI(httpData.getData());
                        }
                    }
                });
    }
}
